<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">




<title>C#.NET编程----Spring.NET &amp; NHibernate整合(三)  - Spring.Net &amp; NHibernate 技术中文站 - 博客园</title>
<meta name="keywords" content="C#.NET编程,Spring.NET,NHibernate整合">
<meta name="description" content="C#.NET编程----Spring.NET &amp; NHibernate整合(三) --Spring.NET &amp; NHibernate整合这篇文章将上面两篇结合在一起，让Spring.NET的IOC来管理NHibernate。">



<link title="RSS" type="application/rss+xml" rel="alternate" href="http://www.cnblogs.com/it1630/rss">
<link title="RSD" type="application/rsd+xml" rel="EditURI" href="http://www.cnblogs.com/it1630/rsd.xml"> 
  



<link rel="stylesheet" type="text/css" href="index.css" media="all">
</head>
<body>
    <form name="Form1" method="post" action="http://www.cnblogs.com/it1630/archive/2006/12/01/579087.html" id="Form1">
<div>
<input name="__EVENTTARGET" id="__EVENTTARGET" value="" type="hidden">
<input name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" type="hidden">
<input name="__VIEWSTATE" id="__VIEWSTATE" value="" type="hidden">
</div>




        <div align="center">
<ins style="border: medium none ; margin: 0pt; padding: 0pt; display: inline-table; height: 90px; position: relative; visibility: visible; width: 728px;"><ins style="border: medium none ; margin: 0pt; padding: 0pt; display: block; height: 90px; position: relative; visibility: visible; width: 728px;"><iframe allowtransparency="true" hspace="0" id="google_ads_frame1" marginheight="0" marginwidth="0" name="google_ads_frame" src="index_1.html" style="left: 0pt; position: absolute; top: 0pt;" vspace="0" scrolling="no" frameborder="0" height="90" width="728"></iframe></ins></ins>
</div>
<div id="maincontainer">
	<div id="header">
		
<h1><a id="Header1_HeaderTitle" class="headermaintitle" href="http://www.cnblogs.com/it1630/">Spring.Net &amp; NHibernate 技术中文站</a></h1>
<div id="tagline"><span>Spring.NET &amp; NHibernate of C#.NET 技术论坛 <a href="http://www.springframework.cn/" class="smarterwiki-linkify">http://www.springframework.cn/</a></span></div>
<div id="menubar">
<div id="blogstats">
<span>posts(32)</span>
<span>comments(146)</span>
<span>trackbacks(5)</span>

</div>
<ul>
	<li><a id="Header1_MyLinks1_HomeLink" class="home" href="http://www.cnblogs.com/">博客园</a></li>
	<li><a id="Header1_MyLinks1_ContactLink" accesskey="9" class="contact" href="http://space.cnblogs.com/msg/send/%e3%8a%a3%e9%98%bf%e5%8d%8e">联系</a></li>
	<li><a id="Header1_MyLinks1_XMLLink" href="http://www.cnblogs.com/it1630/rss"><img src="xmlsmall.gif" alt="订阅" style="border-width: 0px;"></a>&nbsp;<a id="Header1_MyLinks1_Syndication" href="http://www.cnblogs.com/it1630/rss">订阅</a></li>
	<li><a id="Header1_MyLinks1_Admin" class="admin" href="http://www.cnblogs.com/it1630/admin/EditPosts.aspx">管理</a></li>		
</ul></div>




	</div>
	<div id="content">
		<div id="left" style="display: inline;">
			
				
<div class="container">
	<div class="containerheader"><h3>News</h3></div>
	<div class="containercontent">
		FastSpring技术支持论坛: <br>
<a href="http://www.springframework.cn/index.php" target="_top">www.springframework.cn</a> 


<div id="profile_block"><a href="http://home.cnblogs.com/it1630/" target="_top">我的主页</a>&nbsp; <a href="http://home.cnblogs.com/it1630/detail/" target="_top">个人资料</a><br><a href="http://home.cnblogs.com/it1630/ing/" target="_top">我的闪存</a>&nbsp; <a href="http://space.cnblogs.com/msg/send/%e3%8a%a3%e9%98%bf%e5%8d%8e" target="_top">发短消息</a></div>
	</div>
</div>

				
				

<div class="container">
<div class="containerheader">
<h3 class="catListTitle">搜索</h3>
</div>
<div class="containercontent">
<div class="div_my_zzk"><input value="" id="q" onkeydown="return zzk_go_enter(event);" class="input_my_zzk" type="text">&nbsp;<input onclick="zzk_go()" value="找找看" id="btnZzk" class="btn_my_zzk" type="button"></div>
</div>
</div>
<div class="container">
	<div class="containerheader">
<h3>常用链接</h3>
</div>
<div class="containercontent">
<ul>
		<li><a id="SingleColumn_ctl02_repeaterLinks_ctl01_lnkLinkItem" href="http://www.cnblogs.com/it1630/OtherPosts.html">我的参与</a></li>
	
		<li><a id="SingleColumn_ctl02_repeaterLinks_ctl02_lnkLinkItem" href="http://www.cnblogs.com/it1630/MyNews.html">我的新闻</a></li>
	
		<li><a id="SingleColumn_ctl02_repeaterLinks_ctl03_lnkLinkItem" href="http://www.cnblogs.com/it1630/RecentComments.html">最新评论</a></li>
	
		<li><a id="SingleColumn_ctl02_repeaterLinks_ctl04_lnkLinkItem" href="http://www.cnblogs.com/it1630/tag/">我的标签</a></li>
	</ul>
</div>
</div>

<div class="container">
<div class="containerheader">
<h3>我的标签</h3>
</div>
<div class="containercontent">
<div id="MyTag">
<ul>
<li><a href="http://www.cnblogs.com/it1630/tag/Spring.NET/">Spring.NET</a>(6)</li><li><a href="http://www.cnblogs.com/it1630/tag/NHibernate/">NHibernate</a>(6)</li><li><a href="http://www.cnblogs.com/it1630/tag/FastSpring.NET/">FastSpring.NET</a>(5)</li><li><a href="http://www.cnblogs.com/it1630/tag/C%23/">C#</a>(4)</li><li><a href="http://www.cnblogs.com/it1630/tag/.NET/">.NET</a>(4)</li><li><a href="http://www.cnblogs.com/it1630/tag/%e4%ba%ba%e8%84%89%e9%80%9a/">人脉通</a>(3)</li><li><a href="http://www.cnblogs.com/it1630/tag/ProjectOffice/">ProjectOffice</a>(3)</li><li><a href="http://www.cnblogs.com/it1630/tag/PMS/">PMS</a>(2)</li><li><a href="http://www.cnblogs.com/it1630/tag/%e9%98%bf%e9%87%8c%e5%b7%b4%e5%b7%b4/">阿里巴巴</a>(2)</li><li><a href="http://www.cnblogs.com/it1630/tag/Ajax/">Ajax</a>(2)</li><li><a href="http://www.cnblogs.com/it1630/tag/">更多</a></li>
</ul>
</div>
</div>
</div>
		<div class="container">
			<div class="containerheader"><h3>随笔分类<span style="font-size: 11px; font-weight: normal;">(38)</span></h3></div>
			
					<ul class="containercontent">
				
					<li><a id="SingleColumn_Categories_CatList_ctl00_LinkList_ctl01_RssLink" title="Subscribe to 精通篇(13)" class="rsslink" href="http://www.cnblogs.com/it1630/category/78360.html/rss"></a><a id="SingleColumn_Categories_CatList_ctl00_LinkList_ctl01_Link" href="http://www.cnblogs.com/it1630/category/78360.html">精通篇(13)</a></li>
				
					<li><a id="SingleColumn_Categories_CatList_ctl00_LinkList_ctl02_RssLink" title="Subscribe to 入门篇(5)" class="rsslink" href="http://www.cnblogs.com/it1630/category/78358.html/rss"></a><a id="SingleColumn_Categories_CatList_ctl00_LinkList_ctl02_Link" href="http://www.cnblogs.com/it1630/category/78358.html">入门篇(5)</a></li>
				
					<li><a id="SingleColumn_Categories_CatList_ctl00_LinkList_ctl03_RssLink" title="Subscribe to 提高篇(9)" class="rsslink" href="http://www.cnblogs.com/it1630/category/78359.html/rss"></a><a id="SingleColumn_Categories_CatList_ctl00_LinkList_ctl03_Link" href="http://www.cnblogs.com/it1630/category/78359.html">提高篇(9)</a></li>
				
					<li><a id="SingleColumn_Categories_CatList_ctl00_LinkList_ctl04_RssLink" title="Subscribe to 我的随笔(11)" class="rsslink" href="http://www.cnblogs.com/it1630/category/77467.html/rss"></a><a id="SingleColumn_Categories_CatList_ctl00_LinkList_ctl04_Link" href="http://www.cnblogs.com/it1630/category/77467.html">我的随笔(11)</a></li>
				
					</ul>
				
			<div class="containerfooter"></div>
		</div>		
	
		<div class="container">
			<div class="containerheader"><h3>随笔档案<span style="font-size: 11px; font-weight: normal;">(32)</span></h3></div>
			
					<ul class="containercontent">
				
					<li><a id="SingleColumn_Categories_CatList_ctl01_LinkList_ctl01_Link" href="http://www.cnblogs.com/it1630/archive/2009/09.html">2009年9月 (3)</a></li>
				
					<li><a id="SingleColumn_Categories_CatList_ctl01_LinkList_ctl02_Link" href="http://www.cnblogs.com/it1630/archive/2009/08.html">2009年8月 (3)</a></li>
				
					<li><a id="SingleColumn_Categories_CatList_ctl01_LinkList_ctl03_Link" href="http://www.cnblogs.com/it1630/archive/2009/06.html">2009年6月 (1)</a></li>
				
					<li><a id="SingleColumn_Categories_CatList_ctl01_LinkList_ctl04_Link" href="http://www.cnblogs.com/it1630/archive/2009/05.html">2009年5月 (2)</a></li>
				
					<li><a id="SingleColumn_Categories_CatList_ctl01_LinkList_ctl05_Link" href="http://www.cnblogs.com/it1630/archive/2009/04.html">2009年4月 (1)</a></li>
				
					<li><a id="SingleColumn_Categories_CatList_ctl01_LinkList_ctl06_Link" href="http://www.cnblogs.com/it1630/archive/2008/05.html">2008年5月 (1)</a></li>
				
					<li><a id="SingleColumn_Categories_CatList_ctl01_LinkList_ctl07_Link" href="http://www.cnblogs.com/it1630/archive/2008/04.html">2008年4月 (2)</a></li>
				
					<li><a id="SingleColumn_Categories_CatList_ctl01_LinkList_ctl08_Link" href="http://www.cnblogs.com/it1630/archive/2008/02.html">2008年2月 (1)</a></li>
				
					<li><a id="SingleColumn_Categories_CatList_ctl01_LinkList_ctl09_Link" href="http://www.cnblogs.com/it1630/archive/2008/01.html">2008年1月 (2)</a></li>
				
					<li><a id="SingleColumn_Categories_CatList_ctl01_LinkList_ctl10_Link" href="http://www.cnblogs.com/it1630/archive/2007/11.html">2007年11月 (1)</a></li>
				
					<li><a id="SingleColumn_Categories_CatList_ctl01_LinkList_ctl11_Link" href="http://www.cnblogs.com/it1630/archive/2007/10.html">2007年10月 (1)</a></li>
				
					<li><a id="SingleColumn_Categories_CatList_ctl01_LinkList_ctl12_Link" href="http://www.cnblogs.com/it1630/archive/2007/09.html">2007年9月 (1)</a></li>
				
					<li><a id="SingleColumn_Categories_CatList_ctl01_LinkList_ctl13_Link" href="http://www.cnblogs.com/it1630/archive/2007/08.html">2007年8月 (3)</a></li>
				
					<li><a id="SingleColumn_Categories_CatList_ctl01_LinkList_ctl14_Link" href="http://www.cnblogs.com/it1630/archive/2007/06.html">2007年6月 (3)</a></li>
				
					<li><a id="SingleColumn_Categories_CatList_ctl01_LinkList_ctl15_Link" href="http://www.cnblogs.com/it1630/archive/2006/12.html">2006年12月 (6)</a></li>
				
					<li><a id="SingleColumn_Categories_CatList_ctl01_LinkList_ctl16_Link" href="http://www.cnblogs.com/it1630/archive/2006/11.html">2006年11月 (1)</a></li>
				
					</ul>
				
			<div class="containerfooter"></div>
		</div>		
	
		<div class="container">
			<div class="containerheader"><h3>文章分类<span style="font-size: 11px; font-weight: normal;">(2)</span></h3></div>
			
					<ul class="containercontent">
				
					<li><a id="SingleColumn_Categories_CatList_ctl02_LinkList_ctl01_RssLink" title="Subscribe to 精通篇" class="rsslink" href="http://www.cnblogs.com/it1630/category/77462.html/rss"></a><a id="SingleColumn_Categories_CatList_ctl02_LinkList_ctl01_Link" href="http://www.cnblogs.com/it1630/category/77462.html">精通篇</a></li>
				
					<li><a id="SingleColumn_Categories_CatList_ctl02_LinkList_ctl02_RssLink" title="Subscribe to 入门篇(1)" class="rsslink" href="http://www.cnblogs.com/it1630/category/77460.html/rss"></a><a id="SingleColumn_Categories_CatList_ctl02_LinkList_ctl02_Link" href="http://www.cnblogs.com/it1630/category/77460.html">入门篇(1)</a></li>
				
					<li><a id="SingleColumn_Categories_CatList_ctl02_LinkList_ctl03_RssLink" title="Subscribe to 提高篇(1)" class="rsslink" href="http://www.cnblogs.com/it1630/category/77461.html/rss"></a><a id="SingleColumn_Categories_CatList_ctl02_LinkList_ctl03_Link" href="http://www.cnblogs.com/it1630/category/77461.html">提高篇(1)</a></li>
				
					</ul>
				
			<div class="containerfooter"></div>
		</div>		
	
		<div class="container">
			<div class="containerheader"><h3>文章档案<span style="font-size: 11px; font-weight: normal;">(2)</span></h3></div>
			
					<ul class="containercontent">
				
					<li><a id="SingleColumn_Categories_CatList_ctl03_LinkList_ctl01_Link" href="http://www.cnblogs.com/it1630/archives/2006/11.html">2006年11月 (2)</a></li>
				
					</ul>
				
			<div class="containerfooter"></div>
		</div>		
	
		<div class="container">
			<div class="containerheader"><h3>合作站点</h3></div>
			
					<ul class="containercontent">
				
					<li><a id="SingleColumn_Categories_CatList_ctl04_LinkList_ctl01_Link" href="http://www.51itsp.com/">ProjectOffice 项目管理</a></li>
				<li style="margin-top: 2px;">ProjectOffice 项目管理软件 项目管理系统</li>
					<li><a id="SingleColumn_Categories_CatList_ctl04_LinkList_ctl02_Link" href="http://www.springframework.cn/" target="_top">Spring.net技术中文站</a></li>
				<li style="margin-top: 2px;">Spring.NET &amp; NHibernate of C#.NET 技术中文论坛</li>
					<li><a id="SingleColumn_Categories_CatList_ctl04_LinkList_ctl03_Link" href="http://www.51muying.com/" target="_top">母婴网</a></li>
				<li style="margin-top: 2px;">母婴网(51muying.Com)是专业的母婴资讯网站。</li>
					<li><a id="SingleColumn_Categories_CatList_ctl04_LinkList_ctl04_Link" href="http://www.alirenmai.com/" target="_top">人脉通</a></li>
				<li style="margin-top: 2px;">阿里人脉网--阿里巴巴开心网，阿里人脉通，阿里巴巴，人脉通</li>
					<li><a id="SingleColumn_Categories_CatList_ctl04_LinkList_ctl05_Link" href="http://www.56easy.com/" target="_top">物流百科 物流知识</a></li>
				<li style="margin-top: 2px;">物流百科-物流知识|物流论文|第三方物流|物流技术|物流行业百科全书
</li>
					</ul>
				
			<div class="containerfooter"></div>
		</div>		
	


<h3 class="catListTitle">最新随笔</h3>
<div class="RecentComment" id="RecentPosts">
<ul style="">
	
	
			<li><a id="SingleColumn_ctl05_RecentPostsList_ctl00_RecentPostsList2_ctl00_Hyperlink1" href="http://www.cnblogs.com/it1630/archive/2009/09/14/1566179.html">1.&nbsp;KeyNotFoundException: 给定关键字不在字典中</a></li>
		
			<li><a id="SingleColumn_ctl05_RecentPostsList_ctl00_RecentPostsList2_ctl01_Hyperlink1" href="http://www.cnblogs.com/it1630/archive/2009/09/14/1566092.html">2.&nbsp;FastSpring.NET v4.1将使用Spring.NET1.3和NHibernate2.1</a></li>
		
		
	
			<li><a id="SingleColumn_ctl05_RecentPostsList_ctl01_RecentPostsList2_ctl00_Hyperlink1" href="http://www.cnblogs.com/it1630/archive/2009/09/12/1565605.html">3.&nbsp;FastSpring.NET v4.1 Sample 提供下载(含FastSpring.NETv4.1bin版)</a></li>
		
		
	
			<li><a id="SingleColumn_ctl05_RecentPostsList_ctl02_RecentPostsList2_ctl00_Hyperlink1" href="http://www.cnblogs.com/it1630/archive/2009/08/26/1554496.html">4.&nbsp;Spring.Net &amp; NHibernate 中文论坛重新开放！</a></li>
		
		
	
			<li><a id="SingleColumn_ctl05_RecentPostsList_ctl03_RecentPostsList2_ctl00_Hyperlink1" href="http://www.cnblogs.com/it1630/archive/2009/08/20/1550808.html">5.&nbsp;FastSpring.NET v4.0 Sample 提供下载</a></li>
		
		
	
			<li><a id="SingleColumn_ctl05_RecentPostsList_ctl04_RecentPostsList2_ctl00_Hyperlink1" href="http://www.cnblogs.com/it1630/archive/2009/08/14/1546178.html">6.&nbsp;母婴网(51muying.Com)</a></li>
		
		
	
			<li><a id="SingleColumn_ctl05_RecentPostsList_ctl05_RecentPostsList2_ctl00_Hyperlink1" href="http://www.cnblogs.com/it1630/archive/2009/06/19/1506413.html">7.&nbsp;[推荐]物流百科-物流行业百科全书</a></li>
		
		
	
			<li><a id="SingleColumn_ctl05_RecentPostsList_ctl06_RecentPostsList2_ctl00_Hyperlink1" href="http://www.cnblogs.com/it1630/archive/2009/05/28/1491380.html">8.&nbsp;今天收到阿里巴巴 人脉通体验邮件</a></li>
		
		
	
			<li><a id="SingleColumn_ctl05_RecentPostsList_ctl07_RecentPostsList2_ctl00_Hyperlink1" href="http://www.cnblogs.com/it1630/archive/2009/05/07/1451282.html">9.&nbsp;新注册了个域名alirenmai.com大家看做个什么网站好？</a></li>
		
		
	
			<li><a id="SingleColumn_ctl05_RecentPostsList_ctl08_RecentPostsList2_ctl00_Hyperlink1" href="http://www.cnblogs.com/it1630/archive/2009/04/24/1442708.html">10.&nbsp;马云涉足SNS社区? alirenmai.com正式启用</a></li>
		
	
</ul>
</div>

<div class="container">
<div class="containerheader"><h3>最新评论
	<a id="SingleColumn__1b122e90e8f1_RSSHyperlink1" href="http://www.cnblogs.com/it1630/CommentsRSS.aspx"><img src="xml.gif" style="border-width: 0px;"></a></h3></div>
	
			<ul style="" class="containercontent">
		
			<li style="">
				<a id="SingleColumn__1b122e90e8f1_CommentList_ctl01_Hyperlink1" href="http://www.cnblogs.com/it1630/archive/2009/09/12/1565605.html#1644773">1.&nbsp;Re:FastSpring.NET v4.1 Sample 提供下载(含FastSpring.NETv4.1bin版)</a>
			</li>
			<li style="">
				有这么强大吗
			</li>
			<li style="text-align: right; margin-right: 4px;">
				--jesery Liang</li>
		
			<li style="">
				<a id="SingleColumn__1b122e90e8f1_CommentList_ctl02_Hyperlink1" href="http://www.cnblogs.com/it1630/archive/2009/05/28/1491380.html#1542734">2.&nbsp;re: 今天收到阿里巴巴 人脉通体验邮件</a>
			</li>
			<li style="">
				1楼的，你不是阿里巴巴“人脉通”的体验用户，当然你觉得是骗人。
<br>
<br>我相信只要是5188体验用户之一的人，看到截图肯定知道是怎么回事！
			</li>
			<li style="text-align: right; margin-right: 4px;">
				--㊣阿华</li>
		
			<li style="">
				<a id="SingleColumn__1b122e90e8f1_CommentList_ctl03_Hyperlink1" href="http://www.cnblogs.com/it1630/archive/2009/05/28/1491380.html#1540805">3.&nbsp;re: 今天收到阿里巴巴 人脉通体验邮件</a>
			</li>
			<li style="">
				建议关了此博客，整天在骗人。
			</li>
			<li style="text-align: right; margin-right: 4px;">
				--jian11111111</li>
		
			<li style="">
				<a id="SingleColumn__1b122e90e8f1_CommentList_ctl04_Hyperlink1" href="http://www.cnblogs.com/it1630/archive/2009/05/07/1451282.html#1535079">4.&nbsp;re: 新注册了个域名alirenmai.com大家看做个什么网站好？</a>
			</li>
			<li style="">
				快捷进入阿里人脉通： <a href="http://www.cnblogs.com/it1630/archive/2006/12/01/579087.html" target="_new"></a>
			</li>
			<li style="text-align: right; margin-right: 4px;">
				--㊣阿华</li>
		
			<li style="">
				<a id="SingleColumn__1b122e90e8f1_CommentList_ctl05_Hyperlink1" href="http://www.cnblogs.com/it1630/archive/2009/04/24/1442708.html#1512673">5.&nbsp;re: 马云涉足SNS社区? alikaixin.com正式启用</a>
			</li>
			<li style="">
				我加入了！
<br>
<br><a href="http://www.cnblogs.com/it1630/archive/2006/12/01/579087.html" target="_new" rel="nofollow"></a>
			</li>
			<li style="text-align: right; margin-right: 4px;">
				--龙的传人123</li>
		
			</ul>
		
</div>

<div class="container">
<div class="containerheader"><h3>阅读排行榜</h3></div>
	
			<ul style="" class="containercontent">
		
			<li>
				<a id="SingleColumn_ctl07_TopList_ctl01_Hyperlink1" href="http://www.cnblogs.com/it1630/archive/2006/12/01/578709.html">1.&nbsp;实战C#.NET--Spring.NET &amp; NHibernate的整合(10600)</a>
			</li>
		
			<li>
				<a id="SingleColumn_ctl07_TopList_ctl02_Hyperlink1" href="http://www.cnblogs.com/it1630/archive/2006/12/01/579059.html">2.&nbsp;C#.NET编程----Spring.NET &amp; NHibernate整合(一)(8277)</a>
			</li>
		
			<li>
				<a id="SingleColumn_ctl07_TopList_ctl03_Hyperlink1" href="http://www.cnblogs.com/it1630/archive/2006/12/01/579087.html">3.&nbsp;C#.NET编程----Spring.NET &amp; NHibernate整合(三) (4117)</a>
			</li>
		
			<li>
				<a id="SingleColumn_ctl07_TopList_ctl04_Hyperlink1" href="http://www.cnblogs.com/it1630/archive/2007/11/06/950876.html">4.&nbsp;国内第一个支持Spring.NET/NHibernate/Ajax的开源的Framework(3955)</a>
			</li>
		
			<li>
				<a id="SingleColumn_ctl07_TopList_ctl05_Hyperlink1" href="http://www.cnblogs.com/it1630/archive/2006/12/01/579060.html">5.&nbsp;C#.NET编程----Spring.NET &amp; NHibernate整合(二)(3768)</a>
			</li>
		
			</ul>
		

</div>

<div class="container">
<div class="containerheader">
<h3>评论排行榜</h3>
</div>
	
			<ul style="" class="containercontent">
		
			<li>
				<a id="SingleColumn_ctl08_TopList_ctl01_Hyperlink1" href="http://www.cnblogs.com/it1630/archive/2007/08/24/868513.html">1.&nbsp;FastSpring.NET V2.05 RC1 发布[包含全部源代码](25)</a>
			</li>
		
			<li>
				<a id="SingleColumn_ctl08_TopList_ctl02_Hyperlink1" href="http://www.cnblogs.com/it1630/archive/2007/11/06/950876.html">2.&nbsp;国内第一个支持Spring.NET/NHibernate/Ajax的开源的Framework(21)</a>
			</li>
		
			<li>
				<a id="SingleColumn_ctl08_TopList_ctl03_Hyperlink1" href="http://www.cnblogs.com/it1630/archive/2006/12/05/582973.html">3.&nbsp;OASystemWeb of Spring.NET &amp; NHibernate 发布V0.1(15)</a>
			</li>
		
			<li>
				<a id="SingleColumn_ctl08_TopList_ctl04_Hyperlink1" href="http://www.cnblogs.com/it1630/archive/2006/12/01/578709.html">4.&nbsp;实战C#.NET--Spring.NET &amp; NHibernate的整合(15)</a>
			</li>
		
			<li>
				<a id="SingleColumn_ctl08_TopList_ctl05_Hyperlink1" href="http://www.cnblogs.com/it1630/archive/2006/12/01/579059.html">5.&nbsp;C#.NET编程----Spring.NET &amp; NHibernate整合(一)(14)</a>
			</li>
		
			</ul>
		
</div>

							
		</div>
		<div id="right">
			
					
<div class="container">
	<div class="containerheader"><h3>View Post</h3></div>
	<div class="containercontent">
	<div class="post">
		<h2>
			<a id="ctl03_TitleUrl" href="http://www.cnblogs.com/it1630/archive/2006/12/01/579087.html">C#.NET编程----Spring.NET &amp; NHibernate整合(三) </a>
		</h2>
		<a name="_Toc152731344"><strong><span style="font-size: 16pt; font-family: 黑体;" lang="EN-US"><br>
<br>
Spring.NET </span><span style="font-size: 16pt; font-family: 黑体;">与<span lang="EN-US"> NHibernate </span>的整合</span></strong></a><br>
<br>
<span style="font-size: 12pt; font-family: 宋体;">我们成功的运行了自己的第一个<span lang="EN-US">Spring.NET</span>程序和第一个<span lang="EN-US">NHibernate</span>程序。下面我们将上面的程序整合到一个项目中来。让<span lang="EN-US">Spring.NET</span>的容器来管理<span lang="EN-US">NHibernate</span>。<br>
<br>
<br>
<br>
<a name="_Toc152731345"><strong><span style="font-size: 15pt; font-family: 宋体;">建立新的项目</span><span style="font-size: 15pt; font-family: 黑体;" lang="EN">(SpringNHibernateSample)</span></strong></a><br>
<br>
<span style="font-size: 12pt; font-family: 宋体;">项目名称为：<span lang="EN-US">SpringNHibernateSample</span>　名字空间：<span lang="EN-US">OKEC.Sample<br>
<br>
<br>
<br>
<a name="_Toc152731346"><strong><span style="font-size: 15pt; font-family: 宋体;">添加</span><span style="font-size: 15pt; font-family: 黑体;" lang="EN">NHibernate</span><span style="font-size: 15pt; font-family: 宋体;">程序</span></strong></a><br>
<br>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-indent: 21pt; line-height: 150%;"><span style="font-size: 12pt; line-height: 150%; font-family: 宋体;">将<span lang="EN-US">NHibernateSample</span>项目的<span lang="EN-US">User.cs</span>、<span lang="EN-US">User.hbm.xml</span>加入的新的项目中。<span lang="EN-US"><o:p></o:p></span></span></p>
<span style="font-size: 12pt; font-family: 宋体;">并修改<span lang="EN-US">User.hbm.xml</span>，将其中的<br>
<div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; font-size: 13px; width: 98%; background-color: rgb(238, 238, 238);"><img alt="" src="none.gif" align="top"><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);">&nbsp;name</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&nbsp;OKEC.Sample.NHibernate.NHibernateTest.User,NHibernateSample</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);"><br>
<img alt="" src="none.gif" align="top">&nbsp;table</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">my_users</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);"><br>
<img alt="" src="none.gif" align="top"></span></div>
</span></span></span></span>改为<br>
<div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; font-size: 13px; width: 98%; background-color: rgb(238, 238, 238);"><img alt="" src="none.gif" align="top"><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);">&nbsp;name</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&nbsp;OKEC.Sample.NHibernate.NHibernateTest.User,SpringNHibernateSample</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);"><br>
<img alt="" src="none.gif" align="top">&nbsp;table</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">my_users</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);"><br>
<img alt="" src="none.gif" align="top"></span></div>
<br>
<br>
<br>
<a name="_Toc152731347"><strong><span style="font-size: 15pt; font-family: 宋体;">添加</span><span style="font-size: 15pt; font-family: 黑体;" lang="EN">Spring.NET</span><span style="font-size: 15pt; font-family: 宋体;">的程序<br>
</span></strong></a><br>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt 42pt; text-indent: -21pt; line-height: 150%;"><span style="font-size: 12pt; line-height: 150%; font-family: Wingdings;" lang="EN-US"><span style="">n<span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><strong style=""><span style="font-size: 12pt; line-height: 150%; font-family: 宋体;">首先，</span></strong><span style="font-size: 12pt; line-height: 150%; font-family: 宋体;">需要将<span lang="EN-US">SpringSample</span>项目中的<span lang="EN-US">HelloTest.cs</span>、<span lang="EN-US">Spring_bean.xml</span>、<span lang="EN-US">SpringContext.cs</span>加入到新的项目，并修改其中有用到程序集相关的地方。<span lang="EN-US"><o:p></o:p></span></span></p>
<span style="font-size: 12pt; font-family: 宋体;">如将<span lang="EN-US">Spring_bean.xml</span>中的：<br>
<div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; font-size: 13px; width: 98%; background-color: rgb(238, 238, 238);"><img alt="" src="none.gif" align="top"><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 255);">object</span><span style="color: rgb(0, 0, 0);">&nbsp;id</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">Hello</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&nbsp;type</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">OKEC.Sample.Spring.HelloTest,SpringSample</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 0);">/&gt;</span></div>
改为<br>
<div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; font-size: 13px; width: 98%; background-color: rgb(238, 238, 238);"><img alt="" src="none.gif" align="top"><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 255);">object</span><span style="color: rgb(0, 0, 0);">&nbsp;id</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">Hello</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&nbsp;type</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">OKEC.Sample.Spring.HelloTest,SpringNHibernateSample</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 0);">/&gt;</span></div>
<br>
<br>
<p><span style="font-size: 12pt; font-family: 宋体;"><strong><span style="font-size: 12pt; line-height: 150%; font-family: Wingdings;" lang="EN-US"><span style=""><span style="font-size: 12pt; line-height: 150%; font-family: Wingdings;" lang="EN-US"><span style="">&nbsp; n<span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span></span></span>然后，</strong></span><span style="font-size: 12pt; font-family: 宋体;">添加一个为<span lang="EN-US">NHibernate</span>提供<span lang="EN-US">DbProvider</span>的实现类，此类实现了<span lang="EN-US">Spring.Data.Common.IDbProvider</span>接口，为<span lang="EN-US">NHibernate</span>提供<span lang="EN-US">DbProvider</span>所需的链接字串<span lang="EN-US">(ConnectionString)</span>。<br>
</span></p>
<div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; font-size: 13px; width: 98%; background-color: rgb(238, 238, 238);"><span style="color: rgb(0, 0, 255);">using</span><span style="color: rgb(0, 0, 0);">&nbsp;System;<br>
</span><span style="color: rgb(0, 0, 255);">using</span><span style="color: rgb(0, 0, 0);">&nbsp;Spring.Data.Common;<br>
</span><span style="color: rgb(0, 0, 255);">namespace</span><span style="color: rgb(0, 0, 0);">&nbsp;OKEC.Sample.Spring<br>
{<br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(128, 128, 128);">///</span><span style="color: rgb(0, 128, 0);">&nbsp;</span><span style="color: rgb(128, 128, 128);">&lt;summary&gt;</span><span style="color: rgb(0, 128, 0);"><br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(128, 128, 128);">///</span><span style="color: rgb(0, 128, 0);">&nbsp;SQLPriv&nbsp;的摘要说明。<br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(128, 128, 128);">///</span><span style="color: rgb(0, 128, 0);">&nbsp;</span><span style="color: rgb(128, 128, 128);">&lt;/summary&gt;</span><span style="color: rgb(128, 128, 128);"><br>
</span><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);">&nbsp;SQLProvider:IDbProvider<br>
&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;SQLProvider()<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">&nbsp;TODO:&nbsp;在此处添加构造函数逻辑<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//<br>
</span><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">#region</span><span style="color: rgb(0, 0, 0);">&nbsp;IDbProvider&nbsp;成员</span><span style="color: rgb(0, 0, 0);"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;System.Data.IDbConnection&nbsp;CreateConnection()<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">&nbsp;TODO:&nbsp;&nbsp;添加&nbsp;SQLPriv.CreateConnection&nbsp;实现</span><span style="color: rgb(0, 128, 0);"><br>
</span><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">null</span><span style="color: rgb(0, 0, 0);">;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">string</span><span style="color: rgb(0, 0, 0);">&nbsp;CreateParameterName(</span><span style="color: rgb(0, 0, 255);">string</span><span style="color: rgb(0, 0, 0);">&nbsp;name)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">&nbsp;TODO:&nbsp;&nbsp;添加&nbsp;SQLPriv.CreateParameterName&nbsp;实现</span><span style="color: rgb(0, 128, 0);"><br>
</span><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">null</span><span style="color: rgb(0, 0, 0);">;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;System.Data.IDbDataParameter&nbsp;CreateParameter()<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">&nbsp;TODO:&nbsp;&nbsp;添加&nbsp;SQLPriv.CreateParameter&nbsp;实现</span><span style="color: rgb(0, 128, 0);"><br>
</span><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">null</span><span style="color: rgb(0, 0, 0);">;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">private</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">string</span><span style="color: rgb(0, 0, 0);">&nbsp;_connectionString</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">""</span><span style="color: rgb(0, 0, 0);">;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">string</span><span style="color: rgb(0, 0, 0);">&nbsp;ConnectionString<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">get</span><span style="color: rgb(0, 0, 0);"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">&nbsp;TODO:&nbsp;&nbsp;添加&nbsp;SQLPriv.ConnectionString&nbsp;getter&nbsp;实现</span><span style="color: rgb(0, 128, 0);"><br>
</span><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);">&nbsp;_connectionString;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">set</span><span style="color: rgb(0, 0, 0);"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_connectionString&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;value;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">&nbsp;TODO:&nbsp;&nbsp;添加&nbsp;SQLPriv.ConnectionString&nbsp;setter&nbsp;实现</span><span style="color: rgb(0, 128, 0);"><br>
</span><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">string</span><span style="color: rgb(0, 0, 0);">&nbsp;ExtractError(Exception&nbsp;e)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">&nbsp;TODO:&nbsp;&nbsp;添加&nbsp;SQLPriv.ExtractError&nbsp;实现</span><span style="color: rgb(0, 128, 0);"><br>
</span><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">null</span><span style="color: rgb(0, 0, 0);">;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;System.Data.IDbDataAdapter&nbsp;CreateDataAdapter()<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">&nbsp;TODO:&nbsp;&nbsp;添加&nbsp;SQLPriv.CreateDataAdapter&nbsp;实现</span><span style="color: rgb(0, 128, 0);"><br>
</span><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">null</span><span style="color: rgb(0, 0, 0);">;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">bool</span><span style="color: rgb(0, 0, 0);">&nbsp;IsDataAccessException(Exception&nbsp;e)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">&nbsp;TODO:&nbsp;&nbsp;添加&nbsp;SQLPriv.IsDataAccessException&nbsp;实现</span><span style="color: rgb(0, 128, 0);"><br>
</span><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">false</span><span style="color: rgb(0, 0, 0);">;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;System.Data.IDbCommand&nbsp;CreateCommand()<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">&nbsp;TODO:&nbsp;&nbsp;添加&nbsp;SQLPriv.CreateCommand&nbsp;实现</span><span style="color: rgb(0, 128, 0);"><br>
</span><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">null</span><span style="color: rgb(0, 0, 0);">;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">object</span><span style="color: rgb(0, 0, 0);">&nbsp;CreateCommandBuilder()<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">&nbsp;TODO:&nbsp;&nbsp;添加&nbsp;SQLPriv.CreateCommandBuilder&nbsp;实现</span><span style="color: rgb(0, 128, 0);"><br>
</span><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">null</span><span style="color: rgb(0, 0, 0);">;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;IDbMetadata&nbsp;DbMetadata<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">get</span><span style="color: rgb(0, 0, 0);"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">&nbsp;TODO:&nbsp;&nbsp;添加&nbsp;SQLPriv.DbMetadata&nbsp;getter&nbsp;实现</span><span style="color: rgb(0, 128, 0);"><br>
</span><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">null</span><span style="color: rgb(0, 0, 0);">;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">#endregion</span><span style="color: rgb(0, 0, 0);"><br>
&nbsp;&nbsp;&nbsp;&nbsp;}<br>
}<br>
</span></div>
<br>
<br>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt 42pt; text-indent: -21pt; line-height: 150%;"><span style="font-size: 12pt; line-height: 150%; font-family: Wingdings;" lang="EN-US"><span style="">n<span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span style="font-size: 12pt; line-height: 150%; font-family: 宋体;">最后，添加一个<span lang="EN-US">Spring.Data.NHibernate</span>对<span lang="EN-US">NHibernate</span>的封装对像，此对像实现对<span lang="EN-US">User</span>对像数据操作，继承自<span lang="EN-US"><o:p></o:p></span></span></p>
<span style="font-size: 12pt; font-family: 宋体;" lang="EN-US">Spring.Data.NHibernate.Support.HibernateDaoSupport</span><span style="font-size: 12pt; font-family: 宋体;">。<br>
<div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; font-size: 13px; width: 98%; background-color: rgb(238, 238, 238);"><span style="color: rgb(0, 0, 255);">using</span><span style="color: rgb(0, 0, 0);">&nbsp;System;<br>
</span><span style="color: rgb(0, 0, 255);">using</span><span style="color: rgb(0, 0, 0);">&nbsp;System.Collections;<br>
</span><span style="color: rgb(0, 0, 255);">using</span><span style="color: rgb(0, 0, 0);">&nbsp;Spring.Data.NHibernate.Support;<br>
</span><span style="color: rgb(0, 0, 255);">namespace</span><span style="color: rgb(0, 0, 0);">&nbsp;OKEC.Sample.NHibernate.NHibernateTest<br>
{<br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(128, 128, 128);">///</span><span style="color: rgb(0, 128, 0);">&nbsp;</span><span style="color: rgb(128, 128, 128);">&lt;summary&gt;</span><span style="color: rgb(0, 128, 0);"><br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(128, 128, 128);">///</span><span style="color: rgb(0, 128, 0);">&nbsp;UserDao&nbsp;的摘要说明。<br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(128, 128, 128);">///</span><span style="color: rgb(0, 128, 0);">&nbsp;</span><span style="color: rgb(128, 128, 128);">&lt;/summary&gt;</span><span style="color: rgb(128, 128, 128);"><br>
</span><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);">&nbsp;UserDao&nbsp;:&nbsp;HibernateDaoSupport<br>
&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;UserDao()<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">&nbsp;TODO:&nbsp;在此处添加构造函数逻辑<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//<br>
</span><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">bool</span><span style="color: rgb(0, 0, 0);">&nbsp;SaveObject(User&nbsp;user)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;HibernateTemplate.Save(user);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">true</span><span style="color: rgb(0, 0, 0);">;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">bool</span><span style="color: rgb(0, 0, 0);">&nbsp;DeleteObject(User&nbsp;user)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;HibernateTemplate.Delete(user);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">true</span><span style="color: rgb(0, 0, 0);">;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">bool</span><span style="color: rgb(0, 0, 0);">&nbsp;UpdateObject(User&nbsp;user)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;HibernateTemplate.Update(user);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">true</span><span style="color: rgb(0, 0, 0);">;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;IList&nbsp;GetAllObjectsList()<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);">&nbsp;HibernateTemplate.LoadAll(</span><span style="color: rgb(0, 0, 255);">typeof</span><span style="color: rgb(0, 0, 0);">(User));<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;User&nbsp;Load(Object&nbsp;ID)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);">&nbsp;(User)HibernateTemplate.Load(</span><span style="color: rgb(0, 0, 255);">typeof</span><span style="color: rgb(0, 0, 0);">(User),ID);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
&nbsp;&nbsp;&nbsp;&nbsp;}<br>
}<br>
</span></div>
<br>
<br>
<br>
<br>
<a name="_Toc152731348"><strong><span style="font-size: 15pt; font-family: 宋体;">添加</span><span style="font-size: 15pt; font-family: 黑体;" lang="EN">Spring.NET</span><span style="font-size: 15pt; font-family: 宋体;">为</span><span style="font-size: 15pt; font-family: 黑体;" lang="EN">NHibernate</span><span style="font-size: 15pt; font-family: 宋体;">的容器配置<br>
</span></strong></a><br>
<br>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-indent: 21pt; line-height: 150%;"><span style="font-size: 12pt; line-height: 150%; font-family: 宋体;">现在就可以在<span lang="EN-US">Spring.NET</span>的容器中添加<span lang="EN-US">Nhibernate</span>的配置了。<span lang="EN-US"><o:p></o:p></span></span></p>
<span style="font-size: 12pt; font-family: 宋体;">如下<span lang="EN-US">Spring_nhibernate.xml</span>：<br>
<div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; font-size: 13px; width: 98%; background-color: rgb(238, 238, 238);"><span style="color: rgb(0, 0, 0);">&lt;?</span><span style="color: rgb(0, 0, 0);">xml&nbsp;version</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">1.0</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&nbsp;encoding</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">utf-8</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 0);">?&gt;</span><span style="color: rgb(0, 0, 0);">&nbsp;<br>
</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">objects&nbsp;xmlns</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);"><span><a href="http://www.springframework.net/" class="smarterwiki-linkify">http://www.springframework.net</a></span></span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);"><br>
<br>
&nbsp;</span><span style="color: rgb(0, 0, 0);">&lt;!--</span><span style="color: rgb(0, 0, 0);">&nbsp;NHibernate初始化的&nbsp;</span><span style="color: rgb(0, 0, 0);">--&gt;</span><span style="color: rgb(0, 0, 0);"><br>
</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 255);">object</span><span style="color: rgb(0, 0, 0);">&nbsp;id</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">DbProvider</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&nbsp;type</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">OKEC.Sample.Spring.SQLProvider,SpringNHibernateSample</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);"><br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">property&nbsp;name</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">ConnectionString</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&nbsp;value</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">Data&nbsp;Source=192.168.88.15;Database=liluhua;User&nbsp;ID=sa;Password=sa;Trusted_Connection=False</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">/&gt;</span><span style="color: rgb(0, 0, 0);"><br>
</span><span style="color: rgb(0, 0, 0);">&lt;/</span><span style="color: rgb(0, 0, 255);">object</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);"><br>
<br>
</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 255);">object</span><span style="color: rgb(0, 0, 0);">&nbsp;id</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">SessionFactory</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&nbsp;<br>
type</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">Spring.Data.NHibernate.LocalSessionFactoryObject,&nbsp;Spring.Data.NHibernate</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);"><br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">property&nbsp;name</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">DbProvider</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">ref</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">DbProvider</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">/&gt;</span><span style="color: rgb(0, 0, 0);"><br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">property&nbsp;name</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">MappingAssemblies</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">list</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">value</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);">SpringNhibernateSample</span><span style="color: rgb(0, 0, 0);">&lt;/</span><span style="color: rgb(0, 0, 0);">value</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 0);">&lt;/</span><span style="color: rgb(0, 0, 0);">list</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);"><br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 0);">&lt;/</span><span style="color: rgb(0, 0, 0);">property</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);"><br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">property&nbsp;name</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">HibernateProperties</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">dictionary</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">entry&nbsp;<br>
key</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">hibernate.connection.provider</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&nbsp;value</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">NHibernate.Connection.DriverConnectionProvider</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">/&gt;</span><span style="color: rgb(0, 0, 0);">&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 0);">&lt;!--</span><span style="color: rgb(0, 0, 0);">entry&nbsp;<br>
key</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">hibernate.connection.connection_string</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&nbsp;value</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">Data&nbsp;Source=192.168.188.188;Database=Test;User&nbsp;ID=satest;Password=satest;Trusted_Connection=False</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">/--&gt;</span><span style="color: rgb(0, 0, 0);">&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">entry&nbsp;key</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">hibernate.dialect</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&nbsp;value</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">NHibernate.Dialect.MsSql2000Dialect</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">/&gt;</span><span style="color: rgb(0, 0, 0);">&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">entry&nbsp;<br>
key</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">hibernate.connection.driver_class</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&nbsp;value</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">NHibernate.Driver.SqlClientDriver</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">/&gt;</span><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 0);">&lt;/</span><span style="color: rgb(0, 0, 0);">dictionary</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);"><br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 0);">&lt;/</span><span style="color: rgb(0, 0, 0);">property</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);">&nbsp;<br>
&nbsp;</span><span style="color: rgb(0, 0, 0);">&lt;/</span><span style="color: rgb(0, 0, 255);">object</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);">&nbsp;<br>
&nbsp;<br>
&nbsp;</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 255);">object</span><span style="color: rgb(0, 0, 0);">&nbsp;id</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">HibernateTransactionManager</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&nbsp;type</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">Spring.Data.NHibernate.HibernateTransactionManager,&nbsp;Spring.Data.NHibernate</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);">&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">property&nbsp;name</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">DbProvider</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">ref</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">DbProvider</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">/&gt;</span><span style="color: rgb(0, 0, 0);"><br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">property&nbsp;name</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">sessionFactory</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">ref</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">SessionFactory</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">/&gt;</span><span style="color: rgb(0, 0, 0);"><br>
&nbsp;</span><span style="color: rgb(0, 0, 0);">&lt;/</span><span style="color: rgb(0, 0, 255);">object</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);"><br>
&nbsp;<br>
&nbsp;</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 255);">object</span><span style="color: rgb(0, 0, 0);">&nbsp;id</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">TransactionInterceptor</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&nbsp;<br>
type</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">Spring.Transaction.Interceptor.TransactionInterceptor,&nbsp;Spring.Data</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);"><br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">property&nbsp;name</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">TransactionManager</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">ref</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">HibernateTransactionManager</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">/&gt;</span><span style="color: rgb(0, 0, 0);"><br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">property&nbsp;name</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">TransactionAttributeSource</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 255);">object</span><span style="color: rgb(0, 0, 0);">&nbsp;<br>
type</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">Spring.Transaction.Interceptor.AttributesTransactionAttributeSource,&nbsp;Spring.Data</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">/&gt;</span><span style="color: rgb(0, 0, 0);">&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 0);">&lt;/</span><span style="color: rgb(0, 0, 0);">property</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);">&nbsp;<br>
&nbsp;</span><span style="color: rgb(0, 0, 0);">&lt;/</span><span style="color: rgb(0, 0, 255);">object</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);"><br>
&nbsp;<br>
&nbsp;</span><span style="color: rgb(0, 0, 0);">&lt;!--</span><span style="color: rgb(0, 0, 0);">&nbsp;以下是业务相关的&nbsp;</span><span style="color: rgb(0, 0, 0);">--&gt;<br>
</span><span style="color: rgb(0, 0, 0);">
<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span style="font-size: 9pt; font-family: 宋体;" lang="EN-US">&lt;object id="UserDao"<o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-indent: 27pt;"><span style="font-size: 9pt; font-family: 宋体;" lang="EN-US"><span style="">&nbsp;</span>type="OKEC.Sample.NHibernate.NHibernateTest.UserDao, SpringNHibernateSample"&gt;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span style="font-size: 9pt; font-family: 宋体;" lang="EN-US"><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>&lt;property name="SessionFactory" ref="SessionFactory"/&gt;<o:p></o:p></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span style="font-size: 9pt; font-family: 宋体;" lang="EN-US"><span style="">&nbsp;</span>&lt;/object&gt;<o:p></o:p></span></p>
<span style="font-size: 9pt; font-family: 宋体;" lang="EN-US">&lt;/objects&gt;</span><br>
</span></div>
<br>
<br>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-indent: 21pt; line-height: 150%;"><span style="font-size: 12pt; line-height: 150%; font-family: 宋体;">我们现在对上面的加以细解：<span lang="EN-US"><o:p></o:p></span></span></p>
<span style="font-size: 12pt; font-family: 宋体;">下面这几行，是配置<span lang="EN-US">Nhibernate</span>所需的数据库的<span lang="EN-US">DbProvider<br>
<div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; font-size: 13px; width: 98%; background-color: rgb(238, 238, 238);"><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 255);">object</span><span style="color: rgb(0, 0, 0);">&nbsp;id</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">DbProvider</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&nbsp;type</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">OKEC.Sample.Spring.SQLProvider,SpringNHibernateSample</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);"><br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">property&nbsp;name</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">ConnectionString</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&nbsp;value</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">Data&nbsp;Source=192.168.88.15;Database=liluhua;User&nbsp;ID=sa;Password=sa;Trusted_Connection=False</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">/&gt;</span><span style="color: rgb(0, 0, 0);"><br>
</span><span style="color: rgb(0, 0, 0);">&lt;/</span><span style="color: rgb(0, 0, 255);">object</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);"><br>
</span></div>
<br>
<br>
<br>
<span style="font-size: 12pt; font-family: 宋体;">下面的是对<span lang="EN-US">Nhibernate</span>的<span lang="EN-US">SessionFactory</span>的封装的对像的定义<br>
<div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; font-size: 13px; width: 98%; background-color: rgb(238, 238, 238);"><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 255);">object</span><span style="color: rgb(0, 0, 0);">&nbsp;id</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">SessionFactory</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&nbsp;<br>
type</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">Spring.Data.NHibernate.LocalSessionFactoryObject,&nbsp;Spring.Data.NHibernate</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);"><br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">property&nbsp;name</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">DbProvider</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">ref</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">DbProvider</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">/&gt;</span><span style="color: rgb(0, 0, 0);"><br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">property&nbsp;name</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">MappingAssemblies</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">list</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">value</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);">SpringNhibernateSample</span><span style="color: rgb(0, 0, 0);">&lt;/</span><span style="color: rgb(0, 0, 0);">value</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 0);">&lt;/</span><span style="color: rgb(0, 0, 0);">list</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);"><br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 0);">&lt;/</span><span style="color: rgb(0, 0, 0);">property</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);"><br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">property&nbsp;name</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">HibernateProperties</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">dictionary</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">entry&nbsp;key</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">hibernate.connection.provider</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&nbsp;value</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">NHibernate.Connection.DriverConnectionProvider</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">/&gt;</span><span style="color: rgb(0, 0, 0);">&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 0);">&lt;!--</span><span style="color: rgb(0, 0, 0);">entry&nbsp;key</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">hibernate.connection.connection_string</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&nbsp;value</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">Data&nbsp;Source=192.168.188.188;Database=Test;User&nbsp;ID=satest;Password=satest;Trusted_Connection=False</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">/--&gt;</span><span style="color: rgb(0, 0, 0);">&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">entry&nbsp;key</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">hibernate.dialect</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&nbsp;value</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">NHibernate.Dialect.MsSql2000Dialect</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">/&gt;</span><span style="color: rgb(0, 0, 0);">&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">entry&nbsp;key</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">hibernate.connection.driver_class</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&nbsp;value</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">NHibernate.Driver.SqlClientDriver</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">/&gt;</span><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 0);">&lt;/</span><span style="color: rgb(0, 0, 0);">dictionary</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);"><br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 0);">&lt;/</span><span style="color: rgb(0, 0, 0);">property</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);">&nbsp;<br>
&nbsp;</span><span style="color: rgb(0, 0, 0);">&lt;/</span><span style="color: rgb(0, 0, 255);">object</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);"><br>
</span></div>
<br>
<br>
<br>
<span style="font-size: 12pt; font-family: 宋体;">下面的是对<span lang="EN-US">Nhibernate</span>中的<span lang="EN-US">Transaction</span>封装对像<br>
<div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; font-size: 13px; width: 98%; background-color: rgb(238, 238, 238);"><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 255);">object</span><span style="color: rgb(0, 0, 0);">&nbsp;id</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">HibernateTransactionManager</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&nbsp;type</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">Spring.Data.NHibernate.HibernateTransactionManager,&nbsp;Spring.Data.NHibernate</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);">&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">property&nbsp;name</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">DbProvider</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">ref</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">DbProvider</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">/&gt;</span><span style="color: rgb(0, 0, 0);"><br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">property&nbsp;name</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">sessionFactory</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">ref</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">SessionFactory</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">/&gt;</span><span style="color: rgb(0, 0, 0);"><br>
&nbsp;</span><span style="color: rgb(0, 0, 0);">&lt;/</span><span style="color: rgb(0, 0, 255);">object</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);"><br>
&nbsp;<br>
&nbsp;</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 255);">object</span><span style="color: rgb(0, 0, 0);">&nbsp;id</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">TransactionInterceptor</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&nbsp;type</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">Spring.Transaction.Interceptor.TransactionInterceptor,&nbsp;Spring.Data</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);"><br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">property&nbsp;name</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">TransactionManager</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">ref</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">HibernateTransactionManager</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">/&gt;</span><span style="color: rgb(0, 0, 0);"><br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">property&nbsp;name</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">TransactionAttributeSource</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 255);">object</span><span style="color: rgb(0, 0, 0);">&nbsp;type</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">Spring.Transaction.Interceptor.AttributesTransactionAttributeSource,&nbsp;Spring.Data</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">/&gt;</span><span style="color: rgb(0, 0, 0);">&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 0);">&lt;/</span><span style="color: rgb(0, 0, 0);">property</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);">&nbsp;<br>
&nbsp;</span><span style="color: rgb(0, 0, 0);">&lt;/</span><span style="color: rgb(0, 0, 255);">object</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);"><br>
</span></div>
<br>
<br>
<br>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-indent: 21pt; line-height: 150%;"><span style="font-size: 12pt; line-height: 150%; font-family: 宋体;">下面是对<span lang="EN-US">NHibernate</span>业务操作对像的定义<br>
</span></p>
<div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; font-size: 13px; width: 98%; background-color: rgb(238, 238, 238);"><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 255);">object</span><span style="color: rgb(0, 0, 0);">&nbsp;id</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">UserDao</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&nbsp;<br>
type</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">OKEC.Sample.NHibernate.NHibernateTest.UserDao,&nbsp;SpringNHibernateSample</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">property&nbsp;name</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">SessionFactory</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">ref</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">SessionFactory</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">/&gt;</span><span style="color: rgb(0, 0, 0);"><br>
&nbsp;</span><span style="color: rgb(0, 0, 0);">&lt;/</span><span style="color: rgb(0, 0, 255);">object</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);"><br>
</span></div>
<br>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-indent: 21pt; line-height: 150%;"><span lang="EN-US"><o:p><br>
<a name="_Toc152731349"><span style="font-size: 15pt; font-family: 宋体;"><strong>编写测试程序代码<br>
</strong></span></a><br>
</o:p></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-indent: 21pt; line-height: 150%;"><span style="font-size: 12pt; line-height: 150%; font-family: 宋体;">一切准备就绪，我们就可以编写测试程序的代码了。<span lang="EN-US"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-indent: 21pt; line-height: 150%;"><span style="font-size: 12pt; line-height: 150%; font-family: 宋体;">如下：<span lang="EN-US">StartMain.cs<o:p></o:p></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt; text-indent: 21pt; line-height: 150%;"></p>
<div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; font-size: 13px; width: 98%; background-color: rgb(238, 238, 238);"><span style="color: rgb(0, 0, 255);">using</span><span style="color: rgb(0, 0, 0);">&nbsp;System;<br>
</span><span style="color: rgb(0, 0, 255);">using</span><span style="color: rgb(0, 0, 0);">&nbsp;System.Collections;<br>
</span><span style="color: rgb(0, 0, 255);">using</span><span style="color: rgb(0, 0, 0);">&nbsp;OKEC.Sample.NHibernate.NHibernateTest;<br>
</span><span style="color: rgb(0, 0, 255);">namespace</span><span style="color: rgb(0, 0, 0);">&nbsp;OKEC.Sample.Spring<br>
{<br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(128, 128, 128);">///</span><span style="color: rgb(0, 128, 0);">&nbsp;</span><span style="color: rgb(128, 128, 128);">&lt;summary&gt;</span><span style="color: rgb(0, 128, 0);"><br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(128, 128, 128);">///</span><span style="color: rgb(0, 128, 0);">&nbsp;StartMain&nbsp;的摘要说明。<br>
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(128, 128, 128);">///</span><span style="color: rgb(0, 128, 0);">&nbsp;</span><span style="color: rgb(128, 128, 128);">&lt;/summary&gt;</span><span style="color: rgb(128, 128, 128);"><br>
</span><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);">&nbsp;StartMain<br>
&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;StartMain()<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">&nbsp;TODO:&nbsp;在此处添加构造函数逻辑<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//<br>
</span><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[STAThread]<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">static</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);">&nbsp;Main()&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">Startup&nbsp;Spring&nbsp;&amp;&nbsp;NHibernate&nbsp;Content</span><span style="color: rgb(0, 128, 0);"><br>
</span><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SpringContext.init();<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">Test&nbsp;Spring&nbsp;IOC</span><span style="color: rgb(0, 128, 0);"><br>
</span><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;HelloTest&nbsp;test&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;(HelloTest)SpringContext.Context.GetObject(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">Hello</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;test.Test();<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">Test&nbsp;Spring&nbsp;&amp;&nbsp;NHibernate</span><span style="color: rgb(0, 128, 0);"><br>
</span><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;UserDao&nbsp;dao&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;SpringContext.Context.GetObject(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">UserDao</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">)&nbsp;</span><span style="color: rgb(0, 0, 255);">as</span><span style="color: rgb(0, 0, 0);">&nbsp;UserDao;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;User&nbsp;newUser&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">null</span><span style="color: rgb(0, 0, 0);">;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">try</span><span style="color: rgb(0, 0, 0);"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;newUser&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;dao.Load(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">joe_cool</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">catch</span><span style="color: rgb(0, 0, 0);"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">(newUser</span><span style="color: rgb(0, 0, 0);">==</span><span style="color: rgb(0, 0, 255);">null</span><span style="color: rgb(0, 0, 0);">)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;newUser&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">&nbsp;User();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;newUser.Id&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">joe_cool</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;newUser.UserName&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">Joseph&nbsp;Cool</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;newUser.Password&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">abc123</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;newUser.EmailAddress&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);"><span><a href="mailto:joe@cool.com" class="smarterwiki-linkify">joe@cool.com</a></span></span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;newUser.LastLogon&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;DateTime.Now;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">&nbsp;Tell&nbsp;NHibernate&nbsp;that&nbsp;this&nbsp;object&nbsp;should&nbsp;be&nbsp;saved</span><span style="color: rgb(0, 128, 0);"><br>
</span><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dao.SaveObject(newUser);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;User&nbsp;joeCool&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;dao.Load(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">joe_cool</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">&nbsp;set&nbsp;Joe&nbsp;Cool's&nbsp;Last&nbsp;Login&nbsp;property</span><span style="color: rgb(0, 128, 0);"><br>
</span><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;joeCool.LastLogon&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;DateTime.Now;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">&nbsp;flush&nbsp;the&nbsp;changes&nbsp;from&nbsp;the&nbsp;Session&nbsp;to&nbsp;the&nbsp;Database</span><span style="color: rgb(0, 128, 0);"><br>
</span><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dao.UpdateObject(joeCool);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IList&nbsp;recentUsers&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;dao.GetAllObjectsList();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">foreach</span><span style="color: rgb(0, 0, 0);">(User&nbsp;user&nbsp;</span><span style="color: rgb(0, 0, 255);">in</span><span style="color: rgb(0, 0, 0);">&nbsp;recentUsers)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">Assert.IsTrue(user.LastLogon&nbsp;&gt;&nbsp;(new&nbsp;DateTime(2004,&nbsp;03,&nbsp;14,&nbsp;20,&nbsp;0,&nbsp;0))&nbsp;);&nbsp;</span><span style="color: rgb(0, 128, 0);"><br>
</span><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Console.WriteLine(user.UserName);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Console.WriteLine(user.Password);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Console.ReadLine();</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">让程序停留，回车关闭。</span><span style="color: rgb(0, 128, 0);"><br>
</span><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
&nbsp;&nbsp;&nbsp;&nbsp;}<br>
}<br>
</span></div>
<h2 style="margin: 13pt 0cm 13pt 21pt; text-indent: -21pt; line-height: 150%;"><a name="_Toc152731350"><span style="font-size: 15pt; font-family: 宋体;"><br>
<br>
测试并查看结果</span></a></h2>
<p style="margin: 13pt 0cm 13pt 21pt; text-indent: -21pt; line-height: 150%;"><span style="font-size: 12pt; font-family: 宋体;">如果你看到了以下的输出结果，说明你已经成功了！<br>
</span></p>
<div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; font-size: 13px; width: 98%; background-color: rgb(238, 238, 238);"><span style="color: rgb(0, 0, 0);">This&nbsp;</span><span style="color: rgb(0, 0, 255);">is</span><span style="color: rgb(0, 0, 0);">&nbsp;Spring.NET&nbsp;Sample&nbsp;Test</span><span style="color: rgb(0, 0, 0);">!</span><span style="color: rgb(0, 0, 0);"><br>
Please&nbsp;press&nbsp;Enter&nbsp;close&nbsp;the&nbsp;windows</span><span style="color: rgb(0, 0, 0);">!</span><span style="color: rgb(0, 0, 0);"><br>
Joseph&nbsp;Cool<br>
abc123<br>
</span></div>
</span></span></span></span></span></span></span><span style="color: rgb(128, 128, 128);"><em><font face="宋体"><br>
<br>
文档中的项目源代码请从以下地址下载：<br>
</font></em></span><a href="http://www.springframework.cn/read.php?fid=8&amp;tid=2&amp;toread=1"><span style="color: rgb(128, 128, 128);"><em><font face="宋体">http://www.springframework.cn/read.php?fid=8&amp;tid=2&amp;toread=1</font></em></span></a><a href="http://www.springframework.cn/htm_data/8/0611/2.html"></a><br>
<em><span style="color: rgb(128, 128, 128);"><font face="宋体">完整的文档请下载PDF文档：<br>
</font></span></em><a href="http://www.springframework.cn/read.php?fid=2&amp;tid=1&amp;toread=1"><span style="color: rgb(128, 128, 128);"><em><font face="宋体">http://www.springframework.cn/read.php?fid=2&amp;tid=1&amp;toread=1</font></em></span></a><font face="宋体"> </font>

<div id="digg_block">
<div id="div_digg">										
	<div class="diggit" onclick="DiggIt(579087,23118,1)"> 
		<span class="diggnum" id="digg_count_579087">0</span>
	</div>
	<div class="buryit" onclick="DiggIt(579087,23118,2)"> 
		<span class="burynum" id="bury_count_579087">0</span>
	</div>
	<div class="clear"></div>
	<span style="display: none;" id="span_isdigged_579087">0</span>	
	<div class="diggword" id="digg_word_579087">(请您对文章做出评价)</div>	
</div>
</div>
<div class="clear"></div>
<div id="post_next_prev">
<a href="http://www.cnblogs.com/it1630/archive/2006/12/01/579060.html">« </a> 上一篇：<a href="http://www.cnblogs.com/it1630/archive/2006/12/01/579060.html" title="发布于2006-12-01 15:27">C#.NET编程----Spring.NET &amp; NHibernate整合(二)</a><br>
<a href="http://www.cnblogs.com/it1630/archive/2006/12/05/582973.html">» </a> 下一篇：<a href="http://www.cnblogs.com/it1630/archive/2006/12/05/582973.html" title="发布于2006-12-05 16:30">OASystemWeb of Spring.NET &amp; NHibernate 发布V0.1</a><br>
</div>








		<p class="postfoot">
			posted on 2006-12-01 15:45 <a href="http://www.cnblogs.com/it1630/">㊣阿华</a> 阅读(4117) <a href="#commentform">评论(5)</a> &nbsp;<a href="http://www.cnblogs.com/it1630/admin/EditPosts.aspx?postid=579087">编辑</a> <a href="http://www.cnblogs.com/it1630/AddToFavorite.aspx?id=579087">收藏</a> <a href="#" onclick="PutInWz();return false;">网摘</a>  
		</p>
	</div>
	<img src="579087.html" height="1" width="1">
	
<!--
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
<rdf:Description
rdf:about="http://www.cnblogs.com/it1630/archive/2006/12/01/579087.html"
dc:identifier="http://www.cnblogs.com/it1630/archive/2006/12/01/579087.html"
dc:title=""
trackback:ping="http://www.cnblogs.com/it1630/services/trackbacks/579087.aspx" />
</rdf:RDF>
-->

	</div>
</div>
	<a name="pagedcomment"></a>
<div class="container">
	<div class="containerheader"><h3>View Comments</h3></div>	
	<div id="comments" class="containercontent">
		<span id="span_comment_maxid" style="display: none;">1316010</span>
		
				<div class="post">
					<h5>
						<a href="#579228">#1楼</a><a name="579228" id="comment_anchor_579228"></a>
						&nbsp;&nbsp;<a onclick='ReplyComment("jjx",579228,"")' href="http://www.cnblogs.com/it1630/archive/2006/12/01/579087.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(579228,"")' href="http://www.cnblogs.com/it1630/archive/2006/12/01/579087.html#commentform">引用</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl00_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl00$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl00_EditLink"></a>
					</h5>
					<span id="comment_body_579228" class="blog_comment_body">一般没有必要重新实现DbProvider,spring.data提供了DbProviderFactoryObject，只需如下声明即可
<br>
<br>  &lt;object id="dbProvider" type="Spring.Data.Common.DbProviderFactoryObject,Spring.Data"&gt;
<br>        &lt;property name="Provider" value="SqlServer-2.0"/&gt;
<br>        &lt;property name="ConnectionString" value="server=(local);user id=sa;pwd=;database=nmis"/&gt;
<br>      &lt;/object&gt;</span>
					<div class="postfoot">
						2006-12-01 17:22 | <a id="Comments1_CommentList_ctl00_NameLink" rel="nofllow" href="http://www.cnitblog.com/r.aspx?url=http://bbs.dotnettools.org" target="_top">jjx[未注册用户]</a>
					</div>
				</div>
			
				<div class="post">
					<h5>
						<a href="#581139">#2楼</a><a name="581139" id="comment_anchor_581139"></a>[<span class="louzhu">楼主</span>]
						&nbsp;&nbsp;<a onclick='ReplyComment("㊣阿华",581139,"YLtdbFaTtGfx9UmHXuX9MD6PGd0GbhdQZuXECjd5Dd36EaSwTg+1jQ==")' href="http://www.cnblogs.com/it1630/archive/2006/12/01/579087.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(581139,"YLtdbFaTtGfx9UmHXuX9MD6PGd0GbhdQZuXECjd5Dd36EaSwTg+1jQ==")' href="http://www.cnblogs.com/it1630/archive/2006/12/01/579087.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=%e3%8a%a3%e9%98%bf%e5%8d%8e" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl01_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl01$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl01_EditLink"></a>
					</h5>
					<span id="comment_body_581139" class="blog_comment_body">谢谢!看来得深入研究一下Spring.Data了。</span>
					<div class="postfoot">
						2006-12-04 10:09 | <a id="Comments1_CommentList_ctl01_NameLink" href="http://www.cnblogs.com/it1630/" target="_top">㊣阿华</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/%e3%8a%a3%e9%98%bf%e5%8d%8e" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
					</div>
				</div>
			
				<div class="post">
					<h5>
						<a href="#1316010">#3楼</a><a name="1316010" id="comment_anchor_1316010"></a><a name="Post"></a>
						&nbsp;&nbsp;<a onclick='ReplyComment("NoText",1316010,"zmX5gh9iKquNZrzlFwi4mecqU+2h4Z1BuoOwXMJyZfAOt6UM1pQYXw==")' href="http://www.cnblogs.com/it1630/archive/2006/12/01/579087.html#commentform">回复</a>&nbsp;&nbsp;<a onclick='QuoteComment(1316010,"zmX5gh9iKquNZrzlFwi4mecqU+2h4Z1BuoOwXMJyZfAOt6UM1pQYXw==")' href="http://www.cnblogs.com/it1630/archive/2006/12/01/579087.html#commentform">引用</a>&nbsp;&nbsp;<a title="查看该作者发表过的评论" href="http://www.cnblogs.com/CommentsByAuthor.aspx?author=NoText" target="_top">查看</a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl02_DeleteLink" href="javascript:__doPostBack('Comments1$CommentList$ctl02$DeleteLink','')"></a>&nbsp;&nbsp;<a id="Comments1_CommentList_ctl02_EditLink"></a>
					</h5>
					<span id="comment_body_1316010" class="blog_comment_body">原来Spring是春天的意思。
<br>而Hibernate是冬眠的意思。
<br>外国人取名太有意思了。</span>
					<div class="postfoot">
						2008-09-12 16:34 | <a id="Comments1_CommentList_ctl02_NameLink" href="http://www.cnblogs.com/notext/" target="_top">NoText</a>&nbsp;<a href="http://space.cnblogs.com/msg/send/NoText" title="给此人发送站内短消息" class="sendMsg2This">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
					</div>
				</div>
			
	</div>
</div>

<div id="ctl04_comment_form" class="commentform">




<div id="ctl04_divLoginPannel">
<div class="login_tips">注册用户登录后才能发表评论，请 <a href="http://passport.cnblogs.com/login.aspx?ReturnUrl=http%3a%2f%2fwww.cnblogs.com%2fit1630%2farchive%2f2006%2f12%2f01%2f579087.html%3flogin%3d1%23commentform" class="underline">登录</a> 或 <a href="http://passport.cnblogs.com/register.aspx?ReturnUrl=http%3a%2f%2fwww.cnblogs.com%2fit1630%2farchive%2f2006%2f12%2f01%2f579087.html%23Bottom2" class="underline">注册</a> 。</div>
</div>

<div class="itnews c_ad_block" id="itnews">
<a href="http://news.cnblogs.com/" target="_top">IT新闻</a>:<br>

          ·  <a href="http://news.cnblogs.com/n/55129/" target="_top">雅虎或收购本地搜索和评论提供商Yelp</a><br>
	
          ·  <a href="http://news.cnblogs.com/n/55128/" target="_top">百度销售员工战黑回忆：电话声像战前冲锋号</a><br>
	
          ·  <a href="http://news.cnblogs.com/n/55127/" target="_top">苹果再度反击 要求ITC封杀诺基亚</a><br>
	
          ·  <a href="http://news.cnblogs.com/n/55126/" target="_top">【快乐周末】Google 最新产品： Google Toilet</a><br>
	
          ·  <a href="http://news.cnblogs.com/n/55125/" target="_top">纽约时报：Google与中国</a><br>
	
</div>


<div id="ad_under_comment" class="c_ad_block">
<a href="http://a4.yeshj.com/rd/34138/" target="_top">每天10分钟，轻松学英语</a><br><br>
<div id="google_ads_div_cnblogs_blogpost_bottom1">
<iframe src="index_2.html" style="border: 0pt none ;" marginheight="0" marginwidth="0" name="google_ads_iframe_cnblogs_blogpost_bottom1" id="google_ads_iframe_cnblogs_blogpost_bottom1" scrolling="no" frameborder="0" height="60" width="468"></iframe></div>

<br>
<div id="google_ads_div_cnblogs_blogpost_bottom">
<iframe src="index_3.html" style="border: 0pt none ;" marginheight="0" marginwidth="0" name="google_ads_iframe_cnblogs_blogpost_bottom" id="google_ads_iframe_cnblogs_blogpost_bottom" scrolling="no" frameborder="0" height="250" width="300"></iframe></div>

</div>
<div id="site_nav_under" class="c_ad_block">
网站导航：<br>
<a href="http://www.cnblogs.com/" target="_top">博客园首页</a> &nbsp;<a href="http://news.cnblogs.com/" target="_top">IT新闻</a> &nbsp;<a href="http://home.cnblogs.com/" target="_top">个人主页</a> &nbsp;<a href="http://home.cnblogs.com/ing/" target="_top">闪存</a> &nbsp;<a href="http://job.cnblogs.com/" target="_top">程序员招聘</a> &nbsp;<a href="http://space.cnblogs.com/" target="_top">社区</a> &nbsp;<a href="http://space.cnblogs.com/q/" target="_top">博问</a> &nbsp;<a href="http://wz.cnblogs.com/" target="_top">网摘</a>
</div>
<div id="ad_under_comment2" class="c_ad_block">
<a href="http://www.china-pub.com/STATIC07/0912/zh_ndcx_091212.asp" target="_top"><img src="chinapub_20091222.jpg" alt="" style="border: 0px none ;"></a><br>
<a href="http://www.china-pub.com/itbook/" target="_top">China-pub 计算机图书网上专卖店！6.5万品种2-8折！</a><br>
<a href="http://www.china-pub.com/static07/0901/zh_jueba_090121.asp" target="_top">China-Pub 计算机绝版图书按需印刷服务</a><br>
</div>

<div id="relative_search"><br><b>在知识库中查看：</b><br> <a href="http://kb.cnblogs.com/a/579087/">C#.NET编程----Spring.NET &amp; NHibernate整合(三) </a></div>

</div>


				
		</div>
	</div>	
	<div class="clearing">&nbsp;</div>
</div>
<div id="footer">
	
Powered by:<br> 

<a id="Footer1_Hyperlink3" name="Hyperlink1" href="http://www.cnblogs.com/" style="font-family: Verdana; font-size: 12px;">博客园</a><br>
Copyright © ㊣阿华

</div>
    </form>
	
	
      
    
    
    
</body>
</html>
